﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace applicaiton类
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private void Application_SessionEnding(object sender, SessionEndingCancelEventArgs e)
        {
            e.Cancel = true;
            MessageBox.Show("Can't quit app");
        }

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            MainWindow win = new MainWindow();
            if(e.Args.Length>0)
            {
                string file = e.Args[0];
                if (File.Exists(file)) win.loadFile(file);
            }
            win.Show();
        }
    }

    //protected override void OnSessionEnding(SessionEndingCancelEventArgs e)
    //{
    //    e.Cancel = true;
    //}
}
